package wangjg.xuexiban.entity;

import java.util.ArrayList;
import java.util.List;


/*
 * 使用元素对象模型描述：
 * Element e = new Element();
 * e.setAttribute("type","wangjg.xuexiban.Card");
 * e.setAttribute("description pics",pics_list);
 * e.setAttribute("descripiton videos",video_list);
 * e.setAttribute("names",names_list);
 */

public class Card {
	private Long id;
	private String picture;
	private String video;

	private List<CardName> nameList;

	public Card() {
	}
	
	//-方便的方法--
	public CardName defaultName(){
		if(nameList!=null&&nameList.size()>0){
			return nameList.get(0);
		}
		return null;
	}
	public void addName(CardName cn){
		if(nameList==null){
			nameList = new ArrayList<CardName>();
		}
		nameList.add(cn);
	}
	//-----

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}

	public String getVideo() {
		return video;
	}

	public void setVideo(String video) {
		this.video = video;
	}

	public List<CardName> getNameList() {
		return nameList;
	}

	public void setNameList(List<CardName> list) {
		this.nameList = list;
	}

	@Override
	public String toString() {
		return "Card [id=" + id + ", picture=" + picture + ", video=" + video
				+ ", nameList=" + nameList + "]";
	}


}
